package com.hzk.serviceImpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzk.mapper.GoodMapper;
import com.hzk.pojo.Good;
import com.hzk.service.IGoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author jack
 * @since 2022-04-17
 */
@Service
public class GoodServiceImpl extends ServiceImpl<GoodMapper, Good> implements IGoodService {
    @Autowired
    GoodMapper goodMapper;

    @Override
    public List<Good> findGood() {
        List<Good> goods = goodMapper.selectList(new QueryWrapper<Good>());
        return goods;
    }

    @Override
    public Good findGoodsByid(Long id) {
        Good good = goodMapper.selectById(id);
        return good;
    }
}
